import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class CollectionService {
    private resourceUrl = 'api/collection';

    constructor(private http: HttpClient) {}

    getCollectionByName(name:string):Observable<any>{
        return this.http.get<any>(this.resourceUrl+"/get/" + name);
    }

    updateCollectionById(json:string):Observable<any>{
      return this.http.post<any>(this.resourceUrl+"/update", json);
  }

}